﻿using System;
using System.Collections.Generic;
using System.Text;

namespace AsmResolver.PE.Win32Resources.RCData
{
    public class RCDataEntry : DataSegment
    {
        public ushort LanguageIdentifier
        {
            get;
            set;
        }
        public ushort CodePage
        {
            get;
            set;
        }
        public RCDataEntry(ushort languageIdentifier, ushort codePage) : base(null)
        {
            LanguageIdentifier = languageIdentifier;
            CodePage = codePage;
        }
        public RCDataEntry(byte[] data) : base(data) { }

        public RCDataEntry(DataSegment dataSegment):base(dataSegment.Data)
        {
        }

        public static RCDataEntry FromReader(IBinaryStreamReader reader, ushort codePage)
        {
            RCDataEntry result = new RCDataEntry(FromReader(reader));
            result.CodePage = codePage;
            return result;
        }

        public void SetData(byte[] data)
        {
            Data = data;
        }
    }
}
